import { ref } from "vue";
import './home.less';
import { useRouter, useRoute } from 'vue-router';
import img1 from '@/assets/images/AHTV.png'
import img from '@/assets/images/AHTV1.png'
import img2 from '@/assets/images/AHTV2.png'
import img3 from '@/assets/images/AHTV3.png'
import news1 from '@/assets/images/news1.png'
import news2 from '@/assets/images/news2.png'
import news3 from '@/assets/images/news3.png'
import news4 from '@/assets/images/news4.png'
import news5 from '@/assets/images/news5.png'

const router = useRouter();
const route = useRoute();

const images = ref([img1, img2, img3, img]);
const newsImg = ref([
  {
    src: news1,
    content: '李书福2024新年致辞：心有繁星，前行不辍'
  },{
    src: news2,
    content: '三亚中央商务区与吉利汽车高科技谷 “双园双总部”基地正式落地'
  },{
    src: news3,
    content: '吉利控股集团与中国银行深化合作伙伴关系 加强全面战略协同'
  },{
    src: news4,
    content: '吉利汽车2023年总营收创新高 盈利能力显著提升 新能源转型成果凸显'
  },{
    src: news5,
    content: '极氪在美国纽约证券交易所挂牌上市'
  },
]);
const serviceFlag = ref(false);
const gridProps = ref([
  {
    icon: 'yuanqujieshao',
    con: '园区介绍',
    path: 'parkIntroduction'
  },
  {
    icon: 'ruzhuzhinan',
    con: '入驻指南',
    path: 'guide'
  },
  {
    icon: 'a1',
    con: '来访登记',
    path: 'visitorRegistration'
  },
  {
    icon: 'yewubanli',
    con: '业务办理',
    path: ''
  },
  {
    icon: 'qiyezhengce',
    con: '企业政策',
    path: 'enterprisePolicy'
  },
  {
    icon: 'fuwudianhua',
    con: '服务电话',
    path: 'serviceTelephone'
  },
  {
    icon: 'dibudaohanglan-',
    con: '园区新闻',
    path: 'enterprisePolicy'
  },
  {
    icon: 'rengongfuwu',
    con: '人工服务',
    path: 'serviceManual'
  },
]);
const policyProps = ref([
  {
    status: 'events',
    content: '浙江省关于房价不限购政策',
    record: 1900,
    time: '1小时前',
    src: news1
  },
  {
    status: 'notice',
    content: '浙江高新区科技园补贴政策',
    record: 665,
    time: '2小时前',
    src: news2
  },
  {
    status: 'msg',
    content: '人才激励政策',
    record: 785,
    time: '2小时前',
    src: news3
  },
  {
    status: 'notice',
    content: '招商引资政策',
    record: 899,
    time: '2小时前',
    src: news4
  },
  {
    status: 'msg',
    content: '中小企业融资',
    record: 548,
    time: '2小时前',
    src: null
  },
  {
    status: 'notice',
    content: '上市并购重组',
    record: 120,
    time: '2小时前',
    src: null
  },
]);
const noticeProps = ref([
  '端午放假通知',
  '电梯故障的通知',
  '食堂菜品变更通知',
])

const selectAddress1 = route.query.address || '马来西亚AHTV产业园';
// console.log(selectAddress1, '父')
const selectAddress = () => {
  router.push('/address');
}
const selectNotice = (item: string) => {
  router.push({
    name: 'notice',
    query: {
      msg: item,
      address: selectAddress1,
    }
  });
}

const enterGrid = (path: string) => {
  if (path === 'serviceManual') {
    serviceFlag.value = true;
    window.location.href = "tel: 021-57810920"
    return false;
  }
  router.push(path)
}
